﻿var page = {
    citys: [
        { address: '龙泉驿区', distance: '10km', level: '★★★★★' },
        { address: '锦江区', distance: '20km', level: '★★' },
        { address: '高新区', distance: '15km', level: '★★★★★' },
        { address: '郫都区', distance: '12km', level: '★' },
        { address: '新都区', distance: '17km', level: '★★★' },
        { address: '青白江区', distance: '90km', level: '★★' },
        { address: '双流区', distance: '100km', level: '★' },
        { address: '金牛区', distance: '18km', level: '★★★★' },
        { address: '成华区', distance: '12km', level: '★★★★' },
        { address: '青羊区', distance: '15km', level: '★★★★' },
        { address: '温江区', distance: '16km', level: '★★★' },
    ],
    /* 此方法在第一次显示窗体前发生 */
    onLoad: function (event) {
        var array = [];
        for (var i = 0, len = this.citys.length; i < len; i++) {
            var obj = {};
            obj.address = { value: this.citys[i].address };
            obj.distance = { value: this.citys[i].distance };
            obj.level = { value: this.citys[i].level };
            array.push(obj);
        }
        this.setData({
            listctrl1: {
                list: {
                    page: this,
                    items: [
                        {
                            xml: 'Panels/safePlace',
                            items: array
                        }
                    ]
                }
            }
        })
    },

    /* 此方法展示窗体后发生 */
    onResume: function (event) {

    },

    /* 当前页状态变化为显示时触发 */
    onShow: function (event) {

    },

    /* 当前页状态变化为隐藏时触发 */
    onHide: function (event) {

    },

    /* 此方法关闭窗体前发生 */
    onExit: function (event) {

    },

    onClick: function (event) {
        pm.navigateBack();
    },
};

Page(page);

page = 0;
